<template>
  <div>
    <div class="htm51" >
      <div class="htm52"  v-for="(it, i) in topMovie" :key="it">
        <el-card class="htm53">
          <div class="htm54" v-if="i == 0">
            <el-image class="htm55" :src="one" fit="fill"></el-image>
          </div>
          <div  class="htm54" v-else-if="i == 1">
            <el-image class="htm55" :src="two" fit="fill"></el-image>
          </div>
          <div  class="htm54" v-else-if="i == 2">
            <el-image class="htm55" :src="three" fit="fill"></el-image>
          </div>
          <div  class="htm54" v-else>
            <span class="htm56"
              ><b>{{ i + 1 }}</b></span
            >
          </div>
          <div  class="htm54" v-if="i == 0">
            <span class="htm57"
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div class="htm54" v-else-if="i == 1">
            <span class="htm58" 
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div  class="htm54" v-else-if="i == 2">
            <span class="htm59" 
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div  class="htm54" v-else>
            <span class="htm510"  
              ><b>{{ it.mname }}</b></span
            >
          </div>
          <div class="htm511" >
            <div class="htm512">
              <div class="htm513">
                <span class="htm514"><b>导演:</b>{{ it.director }}</span>
              </div>
              <div style="text-align: left">
                <span  class="htm514"><b>主演:</b>{{ it.mrole }}</span>
              </div>
              <div style="text-align: left">
                <span  class="htm514"><b>类型:</b>{{ it.mtype }}</span>
              </div>
            </div>
            <div class="htm515">
              <div>
                <div v-if="it.rate >= 4">
                  <span class="htm516"
                    ><b>{{ it.rate }}</b></span
                  ><br />
                </div>
                <div v-else-if="it.rate >= 3">
                  <span  class="htm517" 
                    ><b>{{ it.rate }}</b></span
                  ><br />
                </div>
                <div v-else>
                  <span  class="htm518" 
                    ><b>{{ it.rate }}</b></span
                  ><br />
                </div>
                <el-rate
                  v-model="it.rate"
                  size="small"
                  disabled
                  text-color="#ff9900"
                  v-if="it.rate <= 5"
                >
                </el-rate>
                <el-rate v-model="val5" size="small" disabled text-color="#ff9900" v-else>
                </el-rate>
              </div>
            </div>
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'
import '@/assets/scss/userCom/Phone/hotTop5.scss'
const topMovie = ref()
const one = require('@/assets/img/no1.webp')
const two = require('@/assets/img/no2.webp')
const three = require('@/assets/img/no3.webp')
const val5 = 5
onMounted(() => {
  axios.get('/api/movie/getTop5Movie').then((res) => {
    topMovie.value = res.data
  })
})
</script>
